const fs = require("fs")
const path = require("path")

//1、创建读取流
var readStream = fs.createReadStream('./src/styles/main.css')

//2、创建写入流
var writeStream = fs.createWriteStream('./dist/main.min.css')

//3、把读取流通过管道传递给写入流
readStream.pipe(writeStream);

var flieName = path.join(__dirname, './src/styles/main.css');
fs.unlink(flieName, (err)=>{
  if(err) throw err;
})

flieName = path.join(__dirname, './src/styles/main.min.css');
fs.unlink(flieName, (err)=>{
  if(err) throw err;
})


